3.1.47 \(\int \cos (c+d x) (a+i a \tan (c+d x))^3 \, dx\) [47]

Optimal. Leaf size=61 \[ -\frac {3 a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {3 i a^3 \sec (c+d x)}{d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d} \]

[Out]

-3*a^3*arctanh(sin(d*x+c))/d-3*I*a^3*sec(d*x+c)/d-2*I*a*cos(d*x+c)*(a+I*a*tan(d*x+c))^2/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {3577, 3567, 3855} \begin {gather*} -\frac {3 i a^3 \sec (c+d x)}{d}-\frac {3 a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + I*a*Tan[c + d*x])^3,x]

[Out]

(-3*a^3*ArcTanh[Sin[c + d*x]])/d - ((3*I)*a^3*Sec[c + d*x])/d - ((2*I)*a*Cos[c + d*x]*(a + I*a*Tan[c + d*x])^2
)/d

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3577

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[2*b*(d
*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^(n - 1)/(f*m)), x] - Dist[b^2*((m + 2*n - 2)/(d^2*m)), Int[(d*Sec[e + f
*x])^(m + 2)*(a + b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 + b^2, 0] && GtQ[n,
1] && ((IGtQ[n/2, 0] && ILtQ[m - 1/2, 0]) || (EqQ[n, 2] && LtQ[m, 0]) || (LeQ[m, -1] && GtQ[m + n, 0]) || (ILt
Q[m, 0] && LtQ[m/2 + n - 1, 0] && IntegerQ[n]) || (EqQ[n, 3/2] && EqQ[m, -2^(-1)])) && IntegerQ[2*m]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \cos (c+d x) (a+i a \tan (c+d x))^3 \, dx &=-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d}-\left (3 a^2\right ) \int \sec (c+d x) (a+i a \tan (c+d x)) \, dx\\ &=-\frac {3 i a^3 \sec (c+d x)}{d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d}-\left (3 a^3\right ) \int \sec (c+d x) \, dx\\ &=-\frac {3 a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {3 i a^3 \sec (c+d x)}{d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(123\) vs. \(2(61)=122\).
time = 0.57, size = 123, normalized size = 2.02 \begin {gather*} \frac {a^3 \cos ^2(c+d x) \left (6 \tanh ^{-1}\left (\sin (c)+\cos (c) \tan \left (\frac {d x}{2}\right )\right ) \cos (c+d x) (i \cos (3 c)+\sin (3 c))+(-\cos (2 c-d x)+i \sin (2 c-d x)) (5 \cos (c+d x)-i \sin (c+d x))\right ) (-i+\tan (c+d x))^3}{d (\cos (d x)+i \sin (d x))^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + I*a*Tan[c + d*x])^3,x]

[Out]

(a^3*Cos[c + d*x]^2*(6*ArcTanh[Sin[c] + Cos[c]*Tan[(d*x)/2]]*Cos[c + d*x]*(I*Cos[3*c] + Sin[3*c]) + (-Cos[2*c
- d*x] + I*Sin[2*c - d*x])*(5*Cos[c + d*x] - I*Sin[c + d*x]))*(-I + Tan[c + d*x])^3)/(d*(Cos[d*x] + I*Sin[d*x]
)^3)

________________________________________________________________________________________

Maple [A]
time = 0.21, size = 97, normalized size = 1.59

method result size
risch \(-\frac {4 i a^{3} {\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {2 i {\mathrm e}^{i \left (d x +c \right )} a^{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) \(93\)
derivativedivides \(\frac {-i a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )-3 a^{3} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 i a^{3} \cos \left (d x +c \right )+\sin \left (d x +c \right ) a^{3}}{d}\) \(97\)
default \(\frac {-i a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )-3 a^{3} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 i a^{3} \cos \left (d x +c \right )+\sin \left (d x +c \right ) a^{3}}{d}\) \(97\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(-I*a^3*(sin(d*x+c)^4/cos(d*x+c)+(2+sin(d*x+c)^2)*cos(d*x+c))-3*a^3*(-sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c))
)-3*I*a^3*cos(d*x+c)+sin(d*x+c)*a^3)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 82, normalized size = 1.34 \begin {gather*} -\frac {2 i \, a^{3} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} + 3 \, a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} + 6 i \, a^{3} \cos \left (d x + c\right ) - 2 \, a^{3} \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/2*(2*I*a^3*(1/cos(d*x + c) + cos(d*x + c)) + 3*a^3*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 2*sin(d
*x + c)) + 6*I*a^3*cos(d*x + c) - 2*a^3*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 107, normalized size = 1.75 \begin {gather*} \frac {-4 i \, a^{3} e^{\left (3 i \, d x + 3 i \, c\right )} - 6 i \, a^{3} e^{\left (i \, d x + i \, c\right )} - 3 \, {\left (a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) + 3 \, {\left (a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

(-4*I*a^3*e^(3*I*d*x + 3*I*c) - 6*I*a^3*e^(I*d*x + I*c) - 3*(a^3*e^(2*I*d*x + 2*I*c) + a^3)*log(e^(I*d*x + I*c
) + I) + 3*(a^3*e^(2*I*d*x + 2*I*c) + a^3)*log(e^(I*d*x + I*c) - I))/(d*e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

Sympy [A]
time = 0.20, size = 107, normalized size = 1.75 \begin {gather*} - \frac {2 i a^{3} e^{i c} e^{i d x}}{d e^{2 i c} e^{2 i d x} + d} + \frac {3 a^{3} \left (\log {\left (e^{i d x} - i e^{- i c} \right )} - \log {\left (e^{i d x} + i e^{- i c} \right )}\right )}{d} + \begin {cases} - \frac {4 i a^{3} e^{i c} e^{i d x}}{d} & \text {for}\: d \neq 0 \\4 a^{3} x e^{i c} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c))**3,x)

[Out]

-2*I*a**3*exp(I*c)*exp(I*d*x)/(d*exp(2*I*c)*exp(2*I*d*x) + d) + 3*a**3*(log(exp(I*d*x) - I*exp(-I*c)) - log(ex
p(I*d*x) + I*exp(-I*c)))/d + Piecewise((-4*I*a**3*exp(I*c)*exp(I*d*x)/d, Ne(d, 0)), (4*a**3*x*exp(I*c), True))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 234 vs. \(2 (55) = 110\).
time = 0.78, size = 234, normalized size = 3.84 \begin {gather*} \frac {63 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 33 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 63 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 33 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 128 i \, a^{3} e^{\left (3 i \, d x + 3 i \, c\right )} - 192 i \, a^{3} e^{\left (i \, d x + i \, c\right )} + 63 \, a^{3} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 33 \, a^{3} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 63 \, a^{3} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 33 \, a^{3} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right )}{32 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

1/32*(63*a^3*e^(2*I*d*x + 2*I*c)*log(I*e^(I*d*x + I*c) + 1) - 33*a^3*e^(2*I*d*x + 2*I*c)*log(I*e^(I*d*x + I*c)
 - 1) - 63*a^3*e^(2*I*d*x + 2*I*c)*log(-I*e^(I*d*x + I*c) + 1) + 33*a^3*e^(2*I*d*x + 2*I*c)*log(-I*e^(I*d*x +
I*c) - 1) - 128*I*a^3*e^(3*I*d*x + 3*I*c) - 192*I*a^3*e^(I*d*x + I*c) + 63*a^3*log(I*e^(I*d*x + I*c) + 1) - 33
*a^3*log(I*e^(I*d*x + I*c) - 1) - 63*a^3*log(-I*e^(I*d*x + I*c) + 1) + 33*a^3*log(-I*e^(I*d*x + I*c) - 1))/(d*
e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

Mupad [B]
time = 3.64, size = 102, normalized size = 1.67 \begin {gather*} -\frac {6\,a^3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {8\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,2{}\mathrm {i}-10\,a^3}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(a + a*tan(c + d*x)*1i)^3,x)

[Out]

- (6*a^3*atanh(tan(c/2 + (d*x)/2)))/d - (8*a^3*tan(c/2 + (d*x)/2)^2 - 10*a^3 + a^3*tan(c/2 + (d*x)/2)*2i)/(d*(
tan(c/2 + (d*x)/2) - tan(c/2 + (d*x)/2)^2*1i - tan(c/2 + (d*x)/2)^3 + 1i))

________________________________________________________________________________________